|
|
|
|
|
|
|
Characteristics of MDI Child Forms |
|
|
|
|
|
|
|
|
Just as the MDI form has characteristics of its behavior, the MDI child forms also behave in a certain way. The characteristics of an MDI child form are as follows: |
|
|
|
|
|
|
|
|
Each child form is displayed within the confines of the parent form. A child form cannot be moved outside the boundaries of the MDI parent form. |
|
|
|
|
|
|
|
|
When a child window is minimized, its icon is displayed in the parent window, not on the Windows taskbar. |
|
|
|
|
|
|
|
|
When a child form is maximized, it fills the entire inner area of the parent form. Also, the parent form's title bar contains both the name of the parent form and the name of the maximized child form. |
|
|
|
|
|
|
|
|
When one child form is maximized, all other child forms are maximized as well. |
|
|
|
|
|
|
|
|
Creating a Simple MDI Program |
|
|
|
|
|
|
|
|
As you will discover with many programming concepts, the best way to understand how MDI applications work is to create a simple MDI program. This section walks you through the process of setting up a ''shell" of an MDI program. It will contain an MDI form and a single child form. You can then use this program as the basis for a fully functional MDI application. |
|
|
|
|
|
|
|
|
The first step is to start a new project in Visual Basic by choosing File, New Project. |
|
|
|
|
| |
|
|
|
|
The sample project MDITest is available on the Web (www.mcp.com/info) as the zipped file MDITEST.ZIP. This project demonstrates the MDI application concepts discussed in this chapter. The project's code is fully commented to explain each step. |
|
|
|
|
|
|
|
|
|
|
After you start the new project, the next step is to create the MDI parent form. To create the MDI form for your project, select Project, Add MDIForm, or choose MDIForm from the Add Object button's drop-down menu. Then, from the Add MDI Form dialog box, select the MDI Form icon and click Open. When the MDI form is added to your project, it should look like the one in Figure 17.3. |
|
|
|
|
|
|
|
|
Figure 17.3
The MDI form has a darker
background than a standard form. |
|
|
|
|
|